home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / TANK11.ZIP / SOURCE.ZIP / TANKHIT.C < prev    next >
Encoding:
C/C++ Source or Header  |  1993-01-16  |  864 b   |  32 lines

  1. #include "tankdefs.h"
  2. #include "types.h"
  3. #include "extern.h"
  4. #include <dos.h>
  5.  
  6. /* tankhit[#] Routine called when a shot hits a tank
  7.  * void TankHit[TankNumber]
  8.  * requires: tn is the number of the tank that was hit,
  9.  *              sn is the number of the tank that gets the credit
  10.  * ensures:  tank expolsion is shown,  opponent's score updated,
  11.  *              new round started
  12.  */
  13. void TankHit(int tn, int sn)
  14. {
  15.     int i;
  16.     tankRec *t=&tank[tn];
  17.  
  18.     drawit(t->x,t->y,TXDIM,TYDIM,TankEraseBM);
  19.     drawit(t->x,t->y,EXP1XDIM,EXP1YDIM,Explosion1BM);
  20.     newscreen=1;
  21.     delay(3000);
  22.     drawit(t->x, t->y,EXP1XDIM, EXP1YDIM, Explosion1EraseBM);
  23.     t=&tank[sn];
  24.    if (tn != sn) {
  25.        if (TreesOn) t->score+=t->treeshit + 10; 
  26.       else t->score+=10;
  27.    } else { 
  28.          if (t->score>10) t->score-=10;  
  29.    }       
  30.     drawit(t->x, t->y,TXDIM, TYDIM, TankEraseBM);
  31.  
  32. }